<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;

/**
 * Class StaffPeriodFeeDetail.
 *
 * @package namespace App\Models;
 */
class StaffPeriodFeeDetail extends BaseModel implements Transformable
{
    use TransformableTrait;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'staff_id',
        'dorm_id',
        'period_id',
        'staff_person_days',
        'dorm_person_days',
        'total_resource_consume',
        'total_money',
        'fee_id',
        'fee_type',
        'fee_undertake'
    ];

    public function staffPeriodFee()
    {
        return $this->belongsTo(StaffPeriodFee::class);
    }

    public function staff()
    {
        return $this->belongsTo(Staff::class);
    }

    public function dorm()
    {
        return $this->belongsTo(Dorm::class);
    }

    public function period()
    {
        return $this->belongsTo(Period::class);
    }
}
